Making movie clips draggable

Use the Drag Movie Clip statement to move a movie clip while the movie is running. The statement can be set to start or stop a drag operation. A movie clip remains draggable until explicitly stopped by Stop Drag or until another movie clips is made draggable. Only one movie clip is draggable at a time.

Drag Movie Clip has the following parameters:

Start Drag Operation begins dragging the movie clip.
Target specifies the movie clip to drag. Click the button labelled "abc" and choose Target Editor to specify a target visually, or enter a target path in the field. See Specifying targets.
Constrain to Rectangle lets you specify a rectangular area beyond which the movie clip cannot be moved. The left, top, right, and bottom values are relative to the coordinates of the movie clip's parent.
Lock Mouse to Center makes the center of the movie clip appear directly under the mouse pointer as the user moves the pointer. When this option is not selected, the movie clip maintains a position relative to the pointer when the drag operation started.

For example, this action constrains the movie clip named target_item within a 200 x 200 pixel box (offset to the specified coordinates):

On (Press, Release, Outside)
	Start Drag ("target_item", L=100, T=100, R=300, B=300, lockcenter)
End On


 
Drag-and-drop movie clips

For a movie clip that the user can position in any location, use the Start Drag and Stop Drag statements as follows:

On (Press) 
	Start Drag ("movie") 
End On 
On (Release) 
	Stop Drag 
End On 

To create more complicated drag-and-drop behavior, you can evaluate the _droptarget property of the movie clip being dragged. For example, you might examine the _droptarget property to see if the movie was dragged to a specific movie clip (such as a "trash can" movie clip), and then trigger another action. See Creating conditional actions and Writing expressions.